package com.iflytek.exam.mapper;

import java.util.List;
import com.iflytek.exam.domain.ShortAnswer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 简答题Mapper接口
 *
 * @author Dogdog
 * @date 2024-07-07
 */
@Mapper
public interface ShortAnswerMapper
{
    /**
     * 查询简答题
     *
     * @param id 简答题主键
     * @return 简答题
     */
    public ShortAnswer selectShortAnswerById(Long id);

    /**
     * 查询简答题列表
     *
     * @param shortAnswer 简答题
     * @return 简答题集合
     */
    public List<ShortAnswer> selectShortAnswerList(ShortAnswer shortAnswer);

    /**
     * 新增简答题
     *
     * @param shortAnswer 简答题
     * @return 结果
     */
    public int insertShortAnswer(ShortAnswer shortAnswer);

    /**
     * 修改简答题
     *
     * @param shortAnswer 简答题
     * @return 结果
     */
    public int updateShortAnswer(ShortAnswer shortAnswer);

    /**
     * 删除简答题
     *
     * @param id 简答题主键
     * @return 结果
     */
    public int deleteShortAnswerById(Long id);

    /**
     * 批量删除简答题
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteShortAnswerByIds(Long[] ids);

    ShortAnswer selectShortAnswerByTitle(String title);

    @Select("select id from tb_short_answer where qu_bank_id = #{quBankId}")
    public Long[] getAllShortAnswerIds(@Param("quBankId") long quBankId);
}
